const email = require("../lib/Email");
module.exports = router => {
  router.post("/api/getcode", async ctx => {
      let code=Math.random().toFixed(6).slice(-6);
    const result = email.send(
      "yunfei66641@163.com",
      "验证码",
      `<h1>${code}</h1>`
    );
    ctx.body = result;  
  });
};
